package com.test.rabbitmq_extension.Controller;

import com.test.rabbitmq_extension.Constants.Constants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/producer")
public class RabbitController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/ack")
    public void ack(){
        rabbitTemplate.convertAndSend(Constants.ACK_EXCHANGE,"ack","hello world");
    }
}
